package com.ddddddl.zhangben.data;

import android.os.Parcel;
import android.os.Parcelable;

public class Account implements Cloneable, Parcelable {

	public long id;

	public double amount;

	public long firstType;

	public long secondType;

	public String date;

	public String note;

	@Override
	public Account clone() {
		Account o = null;
		try {
			o = (Account) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return o;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(id);
		dest.writeDouble(amount);
		dest.writeLong(firstType);
		dest.writeLong(secondType);
		dest.writeString(date);
		dest.writeString(note);
	}
	
	public static final Parcelable.Creator<Account> CREATOR = new Parcelable.Creator<Account>() {

		@Override
		public Account createFromParcel(Parcel source) {
			Account account = new Account();
			account.id = source.readLong();
			account.amount = source.readDouble();
			account.firstType = source.readLong();
			account.secondType = source.readLong();
			account.date = source.readString();
			account.note = source.readString();
			return account;
		}

		@Override
		public Account[] newArray(int size) {
			return new Account[size];
		}
		
	};

}
